import 'package:flutter/material.dart';

class BookShelf extends StatelessWidget {
  List<Widget> list = [];

  BookShelf({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Center(
          child: Text('书架'),
        ),
      ),
      body: Center(
        child: buildGrid(),
      ),
    );
  }

  List<Container> _buildGridTleList(int count) {
    return List<Container>.generate(
        count,
        (int index) => Container(
                child: const Center(
              child: Text('ssss'),
            )));
  }

  Widget buildGrid() {
    return GridView.extent(
        maxCrossAxisExtent: 15.0,
        padding: const EdgeInsets.all(4.0),
        mainAxisSpacing: 4.0,
        crossAxisSpacing: 4.0,
        children: _buildGridTleList(30));
  }
}
